PowerShell - add "display as" in contact

Hello,

I use this script for import my contact.

http://www.stevieg.org/2010/07/using-powershell-to-import-contacts-into-exchange-and-outlook-live/

Is it possible to add "display as" in the value ?

Thx a lot.

September 2nd, 2015 5:31am

If you add a field to the CSV DisplayAs and then make the following modification to the line that sets the EmailAddress that should work

                    "Email"
                    {
                        $ExchangeContact.EmailAddresses[[Microsoft.Exchange.WebServices.Data.EmailAddressKey]::($MappingArray[1])] = $ContactItem.$Key;
						if($MappingArray[1] -eq "EmailAddress1"){
							$ExchangeContact.EmailAddresses[[Microsoft.Exchange.WebServices.Data.EmailAddressKey]::EmailAddress1].Name = $ContactItem.DisplayAs;
                    	}
					}
cheers
Glen


Free Windows Admin Tool Kit Click here and download it now
September 2nd, 2015 8:00pm

If you add a field to the CSV DisplayAs and then make the following modification to the line that sets the EmailAddress that should work

                    "Email"
                    {
                        $ExchangeContact.EmailAddresses[[Microsoft.Exchange.WebServices.Data.EmailAddressKey]::($MappingArray[1])] = $ContactItem.$Key;
						if($MappingArray[1] -eq "EmailAddress1"){
							$ExchangeContact.EmailAddresses[[Microsoft.Exchange.WebServices.Data.EmailAddressKey]::EmailAddress1].Name = $ContactItem.DisplayAs;
                    	}
					}
cheers
Glen


  • Edited by Glen ScalesMVP Thursday, September 03, 2015 3:32 AM
  • Marked as answer by Bartoch 23 hours 18 minutes ago
September 2nd, 2015 11:59pm

THX A  LOT !

It's working perfectly !

Free Windows Admin Tool Kit Click here and download it now
September 3rd, 2015 4:09am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics